package org.xs.web.http.provider.servlet;

import javax.servlet.http.HttpSession;

import org.xs.web.http.provider.HTTPSession;

public class HTTPServletSession implements HTTPSession{
	private HttpSession delegate;
	
	public HTTPServletSession(HttpSession session){
		this.delegate = session;
	}
	
	@Override
	public void set(String name, Object value) {
		delegate.setAttribute(name, value);
	}

	@Override
	public Object get(String name) {
		return delegate.getAttribute(name);
	}

	@Override
	public Object remove(String name) {
		Object res = get(name);
		if(res == null) return res;
		delegate.removeAttribute(name);
		return res;
	}

	@Override
	public HttpSession getDelegate() {
		return delegate;
	}

	@Override
	public void invalidate() {
		delegate.invalidate();
	}
	
	
}
